package edu.sctu.wulixia.month4and5.day20150519;

/**
 * Created by user05 on 2015/5/19.
 */
/*
TextMore有三个方法，sotrNumber()一个是对老师编号进行排序，
 */

public class TestMore {

    public TestMore(Teacher[] teacher) {
    }

    public void sotrNumber(Teacher[] teacher){
        Teacher[] teacherone = new Teacher[teacher.length];
        for(int i = 0;i<(teacherone.length-1);i++){
            for(int j = 0;j<(teacherone.length-1);j++){
                if (teacher[j].number > teacher[j+1].number){
                    teacherone[0] = teacher[j];
                    teacher[j] = teacher[j+1];
                    teacher[j+1] = teacherone[0];

                }
            }
        }
    }

    /*
    sortStudent()一个是对老师所教学生成绩进行排序。
     */

    public void sortStudent(Student[] student){
        Student[] studentone = new Student[student.length];
        for(int i = 0;i<(studentone.length-1);i++){
            for(int j = 0;j<(studentone.length-1);j++){
                if (student[j].number > student[j+1].number){
                    studentone[0] = student[j];
                    student[j] = student[j+1];
                    student[j+1] = studentone[0];

                }
            }
        }
    }

/*
pritCoded()一个是对老师职称为教授的进行返回
 */

    public Teacher pritCoded(Teacher teacher){
        Teacher teachertwo = null;

        for (int i = 0; i<2; i++){
           if(teacher.position.equals("教授")){
               teachertwo = teacher;
           }
        }
        return teachertwo;
    }
}
